﻿using Coolzon.Common;
using Coolzon.UI.Core.Runtime.Script;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using RT = Coolzon.Metadata.Runtime;

namespace Coolzon.UI.Core
{
    public partial class Widget
    {
        /// <summary>
        /// 触发脚本事件
        /// </summary>
        /// <param name="eventName"></param>
        /// <param name="data"></param>
        public void RaiseScriptEvent(string eventName, params object[] args)
        {
            // 调用脚本
            if (!this.InvokeScriptEvent(PartContext.ScriptEngine, eventName, args))
            {
                Logger.WarningToTag("Script", string.Format("组件:{0}不含有事件:{1}", this.XFullName, eventName));
            }
        }
    }
}
